﻿using MVCTest003.Models;
using MVCTest004.Data;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace MVCTest004.Models
{
    public class MusicStoreDblnitializer:System.Data.Entity.DropCreateDatabaseAlways<MusicStoreDB>
    {
        protected override void Seed(MusicStoreDB context)
        {
            context.Artists.Add(new Artist { Name = "天王" });

            context.Genres.Add(new Genre { Name = "流行音乐", Description = "流行音乐很nice" });

            context.Albums.Add(new Album
            {
                Artist = new Artist { Name = "rush" },
                Genre = new Genre { Name = "rock" },
                Price = 9,
                Title = "Caravan"
            });

            base.Seed(context);
        }
    }
}